package change;

import java.awt.AWTException;
import java.awt.Robot;
import java.awt.event.KeyEvent;

/**
 * Created by zzy on 2018/1/7.
 */
public class client {

    public static void main(String[] args) {
        try
        {
            Robot myRobot = new Robot();
//            myRobot.keyPress(KeyEvent.VK_SHIFT);    // 模拟键盘按下shift键
//            myRobot.keyPress(KeyEvent.VK_Q);        // 模拟键盘按下Q键（小写）
//            myRobot.keyRelease(KeyEvent.VK_Q);      // 模拟键盘释放Q键
//            myRobot.keyRelease(KeyEvent.VK_SHIFT);  // 模拟键盘释放shift键
            // 移动鼠标到坐标（x,y)处，并点击左键
            myRobot.mouseMove(100, 23);                // 移动鼠标到坐标（x,y）处
            myRobot.mousePress(KeyEvent.BUTTON2_DOWN_MASK);     // 模拟按下鼠标左键
            myRobot.mouseRelease(KeyEvent.BUTTON2_DOWN_MASK);   // 模拟释放鼠标左键
            myRobot.setAutoDelay(200);
        } catch (AWTException e)
        {
            e.printStackTrace();
        }
    }
}
